package com.fmjr.web.ftlvariables;

import freemarker.core.Environment;
import freemarker.template.TemplateDirectiveBody;
import freemarker.template.TemplateDirectiveModel;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModel;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.Map;

@Service
public class DistrictDirective implements TemplateDirectiveModel{
	
//	private IBaseDistrictService baseDistrictService = (IBaseDistrictService) SpringUtil.getBean("baseDistrictService");
//
//	@Override
	public void execute(Environment env, @SuppressWarnings("rawtypes") Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException {
//		String code = "";
//		 if(params.get("code") != null){
//	        	code = params.get("code").toString();
//	        	BaseDistrict baseDistrict = baseDistrictService.selectBaseDistrictByCode(code);
//	        	env.getOut().write(baseDistrict!=null?baseDistrict.getName():"");
//	        }
//
	}
   
}  